package kr.hkit.powerjava.chther10;

import java.util.Arrays;
import java.util.Random;

public class LottpGenerater2 {
	private boolean[] lotto;
	private Random rnd;
	private static final int SIZE =6;
	public void LottoGenerater2(){
		lotto = new boolean[45];
		rnd = new Random();
	}
	public void getLottNum() {
		int num = -1;
		for (int i = 0; i < SIZE; i++) {
			num =rnd.nextInt(45);
			if(lotto[num]){
				i--;
			}else{
				lotto[num] =true;
			}
			
		}
	}
	public void prnLottoNum() {
		for (int i = 0; i < lotto.length; i++) {
			if (lotto[i]) {
				System.out.printf("%3d",i+1);
			}
		}
	}
	@Override
	public String toString() {
		return Arrays.toString(lotto);
	}
	public static void main(String[] args) {
		LottpGenerater2 lo2 = new LottpGenerater2();
		System.out.println(lo2);
	}
}
